package com.ruoyi.analysis.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.analysis.mapper.OnlineHistoryZlaMapper;
import com.ruoyi.analysis.domain.OnlineHistoryZla;
import com.ruoyi.analysis.service.IOnlineHistoryZlaService;

/**
 * 制粒一车间分析历史Service业务层处理
 * 
 * @author weihanqiang
 * @date 2025-06-19
 */
@Service
public class OnlineHistoryZlaServiceImpl implements IOnlineHistoryZlaService 
{
    @Autowired
    private OnlineHistoryZlaMapper onlineHistoryZlaMapper;

    /**
     * 查询制粒一车间分析历史
     * 
     * @param onlineResultId 制粒一车间分析历史主键
     * @return 制粒一车间分析历史
     */
    @Override
    public OnlineHistoryZla selectOnlineHistoryZlaByOnlineResultId(Long onlineResultId)
    {
        return onlineHistoryZlaMapper.selectOnlineHistoryZlaByOnlineResultId(onlineResultId);
    }

    /**
     * 查询制粒一车间分析历史列表
     * 
     * @param onlineHistoryZla 制粒一车间分析历史
     * @return 制粒一车间分析历史
     */
    @Override
    public List<OnlineHistoryZla> selectOnlineHistoryZlaList(OnlineHistoryZla onlineHistoryZla)
    {
        return onlineHistoryZlaMapper.selectOnlineHistoryZlaList(onlineHistoryZla);
    }

    /**
     * 新增制粒一车间分析历史
     * 
     * @param onlineHistoryZla 制粒一车间分析历史
     * @return 结果
     */
    @Override
    public int insertOnlineHistoryZla(OnlineHistoryZla onlineHistoryZla)
    {
        onlineHistoryZla.setCreateTime(DateUtils.getNowDate());
        return onlineHistoryZlaMapper.insertOnlineHistoryZla(onlineHistoryZla);
    }

    /**
     * 修改制粒一车间分析历史
     * 
     * @param onlineHistoryZla 制粒一车间分析历史
     * @return 结果
     */
    @Override
    public int updateOnlineHistoryZla(OnlineHistoryZla onlineHistoryZla)
    {
        return onlineHistoryZlaMapper.updateOnlineHistoryZla(onlineHistoryZla);
    }

    /**
     * 批量删除制粒一车间分析历史
     * 
     * @param onlineResultIds 需要删除的制粒一车间分析历史主键
     * @return 结果
     */
    @Override
    public int deleteOnlineHistoryZlaByOnlineResultIds(Long[] onlineResultIds)
    {
        return onlineHistoryZlaMapper.deleteOnlineHistoryZlaByOnlineResultIds(onlineResultIds);
    }

    /**
     * 删除制粒一车间分析历史信息
     * 
     * @param onlineResultId 制粒一车间分析历史主键
     * @return 结果
     */
    @Override
    public int deleteOnlineHistoryZlaByOnlineResultId(Long onlineResultId)
    {
        return onlineHistoryZlaMapper.deleteOnlineHistoryZlaByOnlineResultId(onlineResultId);
    }
}
